Skip to content

Conversation

NikhilCodes
Copy link
Contributor

Fixed Missing return statement.

Fixed Missing return statement.
return n
else:
(recur_fibo(n-1) + recur_fibo(n-2))
return recur_fibo(n-1) + recur_fibo(n-2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return n if n <= 1 else recur_fibo(n-1) + recur_fibo(n-2)

# Fibonacci Sequence Using Recursion

def recur_fibo(n):
if n <= 1:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add this doctest:

def recur_fibo(n):
    """
    >>> [recur_fibo(i) for i in range(12)]
    [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]
    """
    return n if n <= 1 else recur_fibo(n-1) + recur_fibo(n-2)

(recur_fibo(n-1) + recur_fibo(n-2))
return n if n <= 1 else recur_fibo(n-1) + recur_fibo(n-2)

def isPositiveInteger(limit):
Copy link
Member

@cclauss cclauss Oct 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isPositiveInteger() function is too simple to be useful. Please removed it and do the test inline.

Copy link
Member

@cclauss cclauss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

print("The first {limit} terms of the fibonacci series are as follows:") needs to be changed to be an f-string print(f"The ...

@NikhilCodes
Copy link
Contributor Author

I just lost the forked-version hence cannot change (New GitHub user mistakes)
Hence I request reviewer to not mark it spam (Reason: Hacktober).
But I have created another branch to make changes intended to this branch.
New Branch: #1287

@cclauss cclauss closed this Oct 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants